extends FunctionCard

func _init() -> void:
	cost = 5
	card_id = "HuaJuan"

func _ready() -> void:
	card_name = "花卷"
	self_destruction = false
	self_description = "每回合结束后，花卷会吃掉(损失)玩家2枚金币"
	trigger_timing = 4
	label.text = card_name
	self_descrpition_label.text = self_description
	

func cardFunction(deck,scoreMapping,selectedCardsDetail):
	if PlayerDetail.playerMoney > 1:
		run_detail.text = "吃掉2枚金币～"
		showRunDetail()
		PlayerDetail.playerMoney -= 2
		PlayerDetail.playerLostMoney += 2
		await get_tree().create_timer(1).timeout  # 等待
		hideRunDetail()

		
